﻿@model PhotoGallery.Models.ViewModels.VideoViewModel
@using PhotoGallery.Views
@{
    ViewBag.Title = "Preview";
}
<h2>Preview</h2>
<div style="text-align:right">
    <a href="@ViewBag.backUrl">@Labels.back</a>
</div>
@if (@Model.Video == null)
{
    <image src="@Url.Content("~/Content/no_video.jpg")" />
}
else
{
    <div style="float:left; background-color:black">
        <video width="640" height="480" controls autoplay>
          @foreach (var item in Model.VideoAttachments)
            {
                if (File.Exists(item.FullFileName))
                {
                    @*<source src="@Url.Action("DownloadVideo", new { file = item.FullFileName, mimeType=item.MimeType })" type="@item.MimeType">*@
                    <source src="@Url.Content(item.Url)" type="@item.MimeType">
                }
            }
            <source src="@Url.Content(@Model.Video.Url)" type="@Model.Video.MimeType">
          Your browser does not support the video tag.
        </video>
    </div>
    <div style="float:left; padding-left:20px">
        @foreach (var video in Model.Videos)
        {
            if(video.ID != Model.Video.ID)
            {
                <div>
                    <a href="@Url.Action("Show","Gallery",new { id = video.ID })">
                        <img alt="@video.Title" src="@Url.Action("Thumbnail", new { file = video.FullThumbnailName })"/>
                    </a>
                    <p>@video.Title</p>
                </div>
            }
        }
    </div>
}
@*<video src="~/uploads/galleries/simo/album2/HDV_0019.MP4" width="320" height="240"  controls>
  Your browser does not support the <code>video</code> element.
</video>*@

@*<video width="320" height="240" controls>
  <source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4">
  <source src="http://www.w3schools.com/html/movie.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>*@
